
/**
 * Content: Exception-异常
 * --------------------------------------------------
 * 初识 Java 异常 - Exception: https://juejin.cn/post/6962021539914973214
 */

public class java_1500_error_Exception {
    public static void main(String[] args) {

        // Exception-异常
        System.out.println("--------------------Exception-异常--------------------");

        try {
            int result = 10 / 0;
            System.out.println("运算结果:" + result);

        } catch (ArithmeticException e) {
            System.out.println("运算出现异常...");
            System.out.println("异常getMessage:" + e.getMessage());
            System.out.println("异常toString:" + e.toString());
            e.printStackTrace();
        } finally {
            System.out.println("想必你也已经知道有没有异常了, finally - 再见！");
        }

    }
}
